/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package InterfaceGraphique;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author arthur.sorokaty
 */
public class ImagePanel extends JPanel {

    private Image image;

    public ImagePanel(Image image)
    {
         this.image = image;
         Dimension size= new Dimension(image.getWidth(null), image.getHeight(null));
         setPreferredSize(size);
         setMinimumSize(size);
         setMaximumSize(size);
         setLayout(null);
    }

    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        g.drawImage(image, 0, 0, null);
    }

}
